<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>聚禾影画传媒（北京）股份有限公司</title>
<style>
  #screen {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    user-select: none;
  }

  #container {
    position: fixed;
    z-index: 1;
    top:0;
    left: 0;
    right: 0;
    bottom: 0;
    user-select: none;
  }

  * {
    margin: 0;
    padding: 0;
  }
  .cmt {
    position: absolute;
    user-select: none;
    white-space: nowrap;
  } 
  #screen{
    /*background: url("/static/img/screen.jpg") center center no-repeat;*/
    background-size: cover;
  }
  .bgimg {
    width: 100%;
    height: 100%;
  }
</style>
</head>
<body>
  <div id="container">
    <img src="http://static.acgame.tv/static/juhe/img/screen.jpg" class="bgimg">
    <div id="screen">
    </div>
  </div>
  
  <script src="http://static.acgame.tv/static/juhe/js/core.js"></script>
  <script>
    window.addEventListener("load",function () {

      var screen = document.getElementById('screen');

      var container = document.getElementById('container');

      var cm = new CommentManager(screen);

      cm.init();

      cm.options.global.scale = 2;

      cm.start();

      var time = 0;

      cm.time(time);

      setInterval(function(){
          cm.time(++time * 1000);
      }, 1000);

      window.addEventListener("resize",function () {
          cm.setBounds(screen.offsetWidth, screen.offsetHeight);
      })

      dmsocket.init("fabuhuidanmu");

      dmsocket.onmessage(function(data){
          switch(data.type){
              case 1:
                  if(!/月半|再婚|二婚|汪小菲|大s|小三|上位|妈的|无演技|演技渣|tmd|TMD|他妈的|傻逼|渣男|结婚|第二任老公|第二任丈夫|幸福胖|胖|丑|婚姻|离婚|再婚|孩子|生孩子|王全安|嫖娼|婚变|外遇|出轨|婚恋|真爱|现任老公|袁巴元/i.test(data.data.content)){
                    cm.insert({
                        stime: (time + 1) * 1000,
                        color: 00000000,
                        mode : 1,
                        size : 36,
                        text : data.data.content,
                        border: false,
                        position: 'absolute',
                    });
                  }
                  break;
          }
      });

      container.addEventListener("dblclick",function () {
          if(checkFullScreen()){
              exitFullScreen();
          }else{
              fullScreen();
          }
      })

      function fullScreen(){
          if (container.requestFullscreen) { 
              container.requestFullscreen(); 
          }
          else if (container.mozRequestFullScreen) { 
              container.mozRequestFullScreen();
          }
          else if (container.webkitRequestFullScreen) { 
              container.webkitRequestFullScreen(); 
          }
          else if (container.msRequestFullscreen) {
              container.msRequestFullscreen();
          }
      }

      function exitFullScreen(){
          if (document.exitFullscreen) { 
              document.exitFullscreen(); 
          } 
          else if (document.mozCancelFullScreen) { 
              document.mozCancelFullScreen(); 
          } 
          else if (document.webkitCancelFullScreen) { 
              document.webkitCancelFullScreen(); 
          } 
          else if (document.msExitFullscreen) { 
              document.msExitFullscreen(); 
          }
      }

      function checkFullScreen(){
          return document.fullscreen || document.mozFullScreen || document.webkitIsFullScreen || document.msFullscreenElement;
      }
  })
  </script>
</body>
</html>
